//
// ssfm.h
// NLSE Solver, Created by jmpp on 9/2/10.
// $Id: ssfm.h 16 2010-11-03 14:19:32Z jmpalacios $

/**
* =================================================================
* Copyright (C) 2010, Juan Manuel Palacios. All Rights Reserved.
*
* This software project, which includes this module, is licensed
* as described in the file LICENSE, which you should have received
* as part of this distribution, and may be used only according to
* the terms described therein.
*
* =================================================================
**/


#include <stdint.h>

// I need to better think about the library dependency chain here: if I include the header file below
// it means my library is directly dependent on OpenGL, and I'm not sure I want that.
// We could have a two components library, one component doing the numeric part (thus not having to know
// a single thing about OpenGL), and a second component (OpenGL dependant) doing all the plotting.
#include <OpenGL/OpenGL.h>


#ifndef _SSFM_H_
#define _SSFM_H_


/* Define SSFM version number */
#define SSFM_VERSION_MAJOR 0
#define SSFM_VERSION_MINOR 1
#define SSFM_VERSION_PATCHLEVEL 0


/* True & false definitions */
#ifndef FALSE
#define FALSE 0
#endif /* #ifndef FALSE */

#ifndef TRUE
#define TRUE (!FALSE)
#endif /* #ifndef TRUE */


/* Symbolic name for the visibility("default") attribute. */
#ifndef EXPORT
#define EXPORT __attribute__((visibility("default")))
#endif /* #ifndef EXPORT */


// It would be great to be able to define this at runtime, rather than at compile-time. Investigate!
#ifdef DOUBLE_PRECISION
typedef double real;
#else
typedef float real;
#endif /* #ifdef DOUBLE_PRECISION */

#ifdef __LP64__
typedef int64_t ssfm_integer;
typedef uint64_t ssfm_uinteger;
#else
typedef int32_t ssfm_integer;
typedef uint32_t ssfm_uinteger;
#endif /* #ifdef __LP64__ */


// find more appropriate name for this type (& tag, of course)!
// remember to layout the structure from larger type to smaller, to minimize space usage due to member alignment issues in the 32 Vs. 64 bit debate.
typedef struct _SSFMInput
{
    real (*input_profile)(real);
} SSFMInput;


// this is of course a temporary prototype!
EXPORT SSFMInput *ssfm_init(ssfm_uinteger fft_points);
// this is of course a temporary prototype!
EXPORT void ssfm_analysis(GLsizei, GLsizei, GLfloat *);
// this is of course a temporary prototype!
EXPORT void ssfm_destroy(SSFMInput *data);


#endif /* #ifndef _SSFM_H_ */
